<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<h1>测试异步请求</h1>
<input type="button" value="发出请求" onclick="fn()">
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script>
    function fn() {
        // axios.get("/helloAxios").then(function (response) {
        //     alert(response.data);
        // }).catch(function (error) {
        //     alert(error);
        // })

        axios.get("/helloAxios").then(function (response) {
            alert(response.data);
        })
    }
</script>
</body>
</html>